- avatar = local_assigns[:avatar].nil? || local_assigns[:avatar]
- stars = local_assigns[:stars].nil? || local_assigns[:stars]
- forks = local_assigns[:forks].nil? || local_assigns[:forks]
- merge_requests = local_assigns[:merge_requests].nil? || local_assigns[:merge_requests]
- issues = local_assigns[:issues].nil? || local_assigns[:issues]
- pipeline_status = local_assigns[:pipeline_status].nil? || local_assigns[:pipeline_status]
- skip_namespace = local_assigns[:skip_namespace]
- compact_mode = local_assigns[:compact_mode]
- use_creator_avatar = local_assigns[:use_creator_avatar]
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project)
- updated_tooltip = time_ago_with_tooltip(project.last_activity_at || project.updated_at)
- show_pipeline_status_icon = pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
- last_pipeline = last_pipeline_from_status_cache(project) if show_pipeline_status_icon
- css_controls_class = "with-pipeline-status" if show_pipeline_status_icon && last_pipeline.present?
- css_metadata_classes = "gl-flex gl-items-center !gl-ml-0 !gl-text-inherit icon-wrapper has-tooltip"
- project_avatar_link_label = _("View %{project} project") % { project: project.name }

= render Pajamas::CardComponent.new(card_options: { class: 'gl-justify-between @lg/panel:gl-w-1/4 gl-grow gl-shrink-0 gl-mt-0' }, header_options: { class: 'gl-flex gl-grow gl-items-start gl-gap-5' }) do |c|
  - c.with_header do
    - if avatar
      .project-avatar-container.gl-relative.gl-pb-4
        = link_to project_path(project), class: dom_class(project), aria: { hidden: "true" }, tabindex: "-1" do
          - if project.creator && use_creator_avatar
            = render Pajamas::AvatarComponent.new(project.creator, size: 48, alt: '', avatar_options: { aria: { hidden: "true" } })
          - else
            = render Pajamas::AvatarComponent.new(project, size: 48, alt: '', avatar_options: { aria: { hidden: "true" } })

    .gl-w-full.gl-pt-2.gl-break-anywhere
      .gl-flex.gl-items-center.gl-flex-wrap
        %h3.gl-text-base.gl-leading-20.gl-my-0
          = link_to project_path(project), class: 'gl-text-default hover:gl-text-default gl-mr-3 js-prefetch-document', title: project.name, aria: { label: project_avatar_link_label } do
            %span.namespace-name.gl-font-normal
              - if project.namespace && !skip_namespace
                = project.namespace.human_name
                \/
            %span.project-name<
              = project.name

        = visibility_level_content(project)

      - if show_last_commit_as_description
        .description.gl-hidden.gl-mt-2.gl-text-sm.gl-text-subtle{ class: "@sm/panel:gl-block" }
          = link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")
      - elsif project.description.present?
        .description.gl-hidden.gl-mt-2.gl-text-sm.gl-text-subtle{ class: "@sm/panel:gl-block" }
          = markdown_field(project, :description)

      - if project.topics.any?
        .gl-mt-3.-gl-ml-1
          = render "shared/projects/topics", project: project.present(current_user: current_user)
      - if project.catalog_resource
        = render partial: 'shared/ci_catalog_badge', locals: { href: explore_catalog_path(project.catalog_resource), css_class: 'gl-mt-2', is_published: project.catalog_resource.published? }

      - if explore_projects_tab? && project_license_name(project)
        %span.gl-inline-flex.gl-items-center.gl-mr-3
          = sprite_icon('scale', size: 14, css_class: 'gl-mr-2')
          = project_license_name(project)

  - c.with_body do
    .project-controls{ data: { testid: 'project_controls'} }
      .gl-flex.gl-items-center.gl-gap-2.gl-mb-2.gl-justify-between.gl-flex-wrap
        .controls.gl-flex.gl-items-center.gl-gap-4.gl-flex-wrap{ class: "#{css_controls_class} !gl-pr-0" }
          - if stars
            = link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} star', '%{project} has %{number} stars', project.star_count), number: project.star_count, project: project.name) } do
              = sprite_icon('star-o', size: 14, css_class: 'gl-mr-2')
              = badge_count(project.star_count)
          - if show_count?(disabled: !forks, compact_mode: compact_mode)
            = link_to project_forks_path(project), class: "#{css_metadata_classes} forks", title: _('Forks'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} fork', '%{project} has %{number} forks', project.forks_count), number: project.forks_count, project: project.name) } do
              = sprite_icon('fork', size: 14, css_class: 'gl-mr-2')
              = badge_count(project.forks_count)
          - if show_count?(disabled: !merge_requests, compact_mode: compact_mode)
            = link_to project_merge_requests_path(project), class: "#{css_metadata_classes} merge-requests", title: _('Merge requests'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} open merge request', '%{project} has %{number} open merge requests', project.open_merge_requests_count), number: project.open_merge_requests_count, project: project.name) } do
              = sprite_icon('merge-request', size: 14, css_class: 'gl-mr-2')
              = badge_count(project.open_merge_requests_count)
          - if show_count?(disabled: !issues, compact_mode: compact_mode)
            = link_to project_issues_path(project), class: "#{css_metadata_classes} issues", title: _('Issues'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} open issue', '%{project} has %{number} open issues', project.open_issues_count), number: project.open_issues_count, project: project.name) } do
              = sprite_icon('work-item-issue', size: 14, css_class: 'gl-mr-2')
              = badge_count(project.open_issues_count)

        .gl-flex.gl-items-center.gl-gap-2.-gl-mr-2
          - if show_pipeline_status_icon && last_pipeline.present?
            - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
            %span.icon-wrapper.pipeline-status
              = render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path

          = render 'shared/projects/badges', project: project
      .updated-note.gl-text-sm.gl-whitespace-nowrap.gl-justify-start.gl-text-subtle
        %span
          = _('Updated')
          = updated_tooltip
